<template>
	<view class="content">
		<image class="logo" :src="userInfo.avatarUrl"></image>
		<view class="text-area">
			<text class="title">{{userInfo.nickName}}</text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				userInfo: {}
			}
		},
		onLoad() {
			var _this = this;
			uni.getUserInfo({
				success: function(res) {
					_this.userInfo = res.userInfo
				},
				fail:function(){
					uni.showModal({
						title: '系统提示',
						content: '您尚未授权或授权已过期，部分功能将受限，点击确定将进行授权',
						success: function (res) {
			
						}
					})
				}
			})
			this.test();
		},
		methods: {
			test :function(){
				uni.request({
				    url: 'http://192.168.1.251:18882/xzapi/dolphin/v1/roomDetail?homeId=1ec6e1edb65c4f9b81bc2038546c9046', //仅为示例，并非真实接口地址。
					method: 'POST',
				    data: {
				    },
				    success: (res) => {
				        console.log(res.data);
				    }
				});
			}
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 200rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>
